Skip to main content

script

Type

property

Summary

Specifies the contents of an object's script.

Syntax

set the script of <object> to <string>

Description

Use the script property to examine or change an object's script from inside a LiveCode statement, instead of using the script editor.

An object's script is the code that controls that object. All of an object's handlers are part of its script property.

You can view and change a script directly by selecting the object and choosing Object menu. Use the script property within a handler to check the contents of a script, or change the script.

LiveCode compiles the script immediately after it is set. This means that it is not possible to write a self-modifying handler, because the currently-executing handler would have to be changed and re-compiled while it was running.

Examples

set the script of button 2 to empty -- clear out the script
set the script of field "Get It" to field "Get It Script"

command: remove script, edit

glossary: object

property: script

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?